package com.dau.mapper.mapper.dept;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dau.common.constants.CommConstants;
import com.dau.common.result.R;
import com.dau.entity.system.dept.DeptAndUser;
import com.dau.entity.system.dept.SysDept;
import com.dau.entity.system.user.SysUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 部门映射器
 *
 * @author tzj
 * @date 2024/11/07
 */
@Mapper
public interface SysDeptMapper extends BaseMapper<SysDept> {
    /**
     * 部门分页数据
     *
     * @param build          建造
     * @param sysUserWrapper 部门参数
     * @return {@link Page }<{@link SysDept }>
     */
    Page<SysDept> selectDeptPage(@Param(CommConstants.PAGE) Page<SysDept> build, @Param(Constants.WRAPPER) Wrapper<SysDept> sysUserWrapper);
    /**
     * 绑定部门和用户
     *
     * @param deptAndUser 部门和用户
     */
    void bind(DeptAndUser deptAndUser);

    /**
     * 查询部门下所有用户信息
     *
     * @param id 身份证件
     * @return {@link SysDept }
     */
    List<SysUser> queryUserListByUserId(@Param("deptId")String id);
}
